﻿using System;

namespace XTengine.ComponentModel
{
    public class Int32Converter : TypeConverter<Int32>
    {
        public override Int32 ConvertFrom(string value)
        {
            Int32 result;
            if (Int32.TryParse(value, out result))
            {
                return result;
            }

            return 0;
        }

        public override string ConvertTo(Int32 value)
        {
            return value.ToString();
        }
    }
}